import config from "@/config"
import http from "@/utils/request"
import { ApiResult } from '@/api/common/ApiResultType'
import PageViewType from '../common/PageViewType'
import { RoleMenuFunctionSaveDto } from './types'
export default {
	/**
	 * 根据角色id获取菜单按钮信息
	 */
	getRoleMenuFunctionsById: {
		url: `${config.API_URL}/sysrolemenufunction/GetRoleMenuFunctionsByRoleId`,
		name: "根据角色id获取菜单按钮信息",
		post: async function (id: string) {
			var res: ApiResult = await http.post(this.url + `?id=` + id);
			return res;
		}
	},
	/**
	 * 保存角色菜单按钮信息
	 */
	save: {
		url: `${config.API_URL}/sysrolemenufunction/save`,
		name: "保存角色菜单按钮信息",
		post: async function (data: RoleMenuFunctionSaveDto) {
			var res: ApiResult = await http.post(this.url, data);
			return res;
		}
	},
}
